package com.xiaoxu.privatechat.bean;


/**
 * @description 错误码统一处理类，所有的错误码统一定义在这里
 * @author xiaoxu
 * @date 2023/2/13
 */
public class CodeMsg {

	/**
	 * 错误码
	 */
	private int code;
	/**
	 * 错误信息
	 */
	private String msg;
	/**
	 * 构造函数私有化即单例模式
	 */
	private CodeMsg(int code,String msg){
		this.code = code;
		this.msg = msg;
	}
	
	public int getCode() {
		return code;
	}



	public void setCode(int code) {
		this.code = code;
	}



	public String getMsg() {
		return msg;
	}



	public void setMsg(String msg) {
		this.msg = msg;
	}
	
	//通用错误码定义
	//处理成功消息码
	public static CodeMsg SUCCESS = new CodeMsg(0, "success");
	//非法数据错误码
	public static CodeMsg DATA_ERROR = new CodeMsg(-1, "非法數據！");
	public static CodeMsg CPACHA_EMPTY = new CodeMsg(-2, "驗證碼不能爲空！");
	public static CodeMsg VALIDATE_ENTITY_ERROR = new CodeMsg(-3, "");
	public static CodeMsg SESSION_EXPIRED = new CodeMsg(-4, "繪畫已失效，請刷新頁面重試！");
	public static CodeMsg CPACHA_ERROR = new CodeMsg(-5, "驗證碼錯誤！");
	public static CodeMsg USER_SESSION_EXPIRED = new CodeMsg(-6, "還未登錄或會話無效，請重新登錄！");
	public static CodeMsg UPLOAD_PHOTO_SUFFIX_ERROR = new CodeMsg(-7, "圖片格式不正確！");
	public static CodeMsg UPLOAD_PHOTO_ERROR = new CodeMsg(-8, "圖片上傳失敗！");
	public static CodeMsg HANDLE_ERROR = new CodeMsg(-9, "操作失敗，請聯係管理員！");
	
	//后台管理类错误码
	//用户管理类错误
	public static CodeMsg ADMIN_USERNAME_EMPTY = new CodeMsg(-2000, "用戶名不能為空！");
	public static CodeMsg ADMIN_PASSWORD_EMPTY = new CodeMsg(-2001, "密碼不能為空！");
	public static CodeMsg ADMIN_NO_RIGHT = new CodeMsg(-2002, "您所屬的角色五權限！");
	
	//登录类错误码
	public static CodeMsg ADMIN_USERNAME_NO_EXIST = new CodeMsg(-3000, "該用戶名不存在！");
	public static CodeMsg ADMIN_PASSWORD_ERROR = new CodeMsg(-3001, "密碼錯誤！");
	public static CodeMsg ADMIN_USER_UNABLE = new CodeMsg(-3002, "該用戶已被凍結，請聯系管理員！");
	public static CodeMsg ADMIN_USER_ROLE_UNABLE = new CodeMsg(-3003, "該用戶所屬角色狀態不可用，請聯系管理員！");
	public static CodeMsg ADMIN_USER_ROLE_AUTHORITES_EMPTY = new CodeMsg(-3004, "該用戶所屬角色無可用許可權，請聯系管理員！");
	
	//后台菜单管理类错误码
	public static CodeMsg ADMIN_MENU_ADD_ERROR = new CodeMsg(-4000, "選單添加失敗，請聯系管理員！");
	public static CodeMsg ADMIN_MENU_EDIT_ERROR = new CodeMsg(-4001, "選單編輯失敗，請聯系管理員！");
	public static CodeMsg ADMIN_MENU_ID_EMPTY = new CodeMsg(-4002, "選單ID不能為空！");
	public static CodeMsg ADMIN_MENU_ID_ERROR = new CodeMsg(-4003, "選單ID錯誤！");
	public static CodeMsg ADMIN_MENU_DELETE_ERROR = new CodeMsg(-4004, "該選單下有子功能表，不允許删除！");
	//后台角色管理类错误码
	public static CodeMsg ADMIN_ROLE_ADD_ERROR = new CodeMsg(-5000, "角色添加失敗，請聯系管理員！");
	public static CodeMsg ADMIN_ROLE_NO_EXIST = new CodeMsg(-5001, "該角色不存在！");
	public static CodeMsg ADMIN_ROLE_EDIT_ERROR = new CodeMsg(-5002, "角色編輯失敗，請聯系管理員！");
	public static CodeMsg ADMIN_ROLE_DELETE_ERROR = new CodeMsg(-5003, "該角色下存在用戶資訊，不可删除！");
	//后台用户管理类错误码
	public static CodeMsg ADMIN_USER_ROLE_EMPTY = new CodeMsg(-6000, "請選擇用戶所屬角色！");
	public static CodeMsg ADMIN_USERNAME_EXIST = new CodeMsg(-6001, "該用戶名已存在，請換一個試試！");
	public static CodeMsg ADMIN_USE_ADD_ERROR = new CodeMsg(-6002, "用戶添加失敗，請聯系管理員！");
	public static CodeMsg ADMIN_USE_NO_EXIST = new CodeMsg(-6003, "用戶不存在！");
	public static CodeMsg ADMIN_USE_EDIT_ERROR = new CodeMsg(-6004, "用戶編輯失敗，請聯系管理員！");
	public static CodeMsg ADMIN_USE_DELETE_ERROR = new CodeMsg(-6005, "該用戶存在關聯數據，不允許删除！");
	
	//后台用户修改密码类错误码
	public static CodeMsg ADMIN_USER_UPDATE_PWD_ERROR = new CodeMsg(-7000, "舊密碼錯誤！");
	public static CodeMsg ADMIN_USER_UPDATE_PWD_EMPTY = new CodeMsg(-7001, "新密碼不能為空！");
	
	//后台用户修改密码类错误码
	public static CodeMsg ADMIN_DATABASE_BACKUP_NO_EXIST = new CodeMsg(-8000, "備份記錄不存在！");

	//前台
	public static CodeMsg ACCOUNT_USERNAME_EXIST = new CodeMsg(-9001, "該用戶名已存在，請換一個試試！");
	public static CodeMsg ACCOUNT_REGISTER_ERROR = new CodeMsg(-9002, "注册失敗，請聯系管理員！");
	public static CodeMsg ACCOUNT_UPDATE_ERROR = new CodeMsg(-9010, "用戶修改失敗，請聯系管理員！");
	public static CodeMsg ACCOUNT_USERNAME_NO_EXIST = new CodeMsg(-9003, "該用戶名不存在！");
	public static CodeMsg ACCOUNT_PASSWORD_ERROR = new CodeMsg(-9004, "密碼錯誤！");
	public static CodeMsg ACCOUNT_STATUS_ERROR = new CodeMsg(-9005, "帳號狀態有問題，請聯系管理員！");
	public static CodeMsg ACCOUNT_STATUS_EXAMINE = new CodeMsg(-9005, "帳號正在稽核中，請聯系審核員稽核！");
	public static CodeMsg ACCOUNT_STATUS_UNABLE = new CodeMsg(-9005, "帳號已被凍結，請聯系管理員！");
	public static CodeMsg ACCOUNT_HAD_DELETE = new CodeMsg(-9006, "你還不是對方好友，請先發送驗證通過後再繼續聊天！！");
	public static CodeMsg ACCOUNT_NO_FRIEND = new CodeMsg(-9007, "對方不是你的好友，請先添加好友再繼續聊天！！");
}
